package com.ssy.lingxi.order.model.vo.mobile.request;

import com.ssy.lingxi.order.handler.annotation.BuyerOrderShopTypeAnnotation;
import com.ssy.lingxi.order.handler.annotation.ManageShopEnvironmentAnnotation;
import com.ssy.lingxi.order.handler.annotation.OrderPayTypeAnnotation;
import com.ssy.lingxi.order.model.vo.basic.request.*;

import javax.validation.Valid;
import javax.validation.constraints.*;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.List;

/**
 * 创建采购订单接口参数VO
 * @author 万宁
 * @version 2.0.0
 * @date 2021-07-17
 */
public class BuyerOrderVO implements Serializable {
    private static final long serialVersionUID = -5792628696318098343L;

    /**
     * 门店ID (通过收货地址获取)
     */
    private Long storeId;

    /**
     * 订单来源商城Id
     */
    @NotNull(message = "订单来源商城Id不能为空")
    private Long shopId;

    /**
     * 商城类型，1-企业商城 3-渠道商城 4-渠道自有商城
     */
    @NotNull(message = "商城类型不能为空")
    @BuyerOrderShopTypeAnnotation
    private Integer shopType;

    /**
     * 商城环境，1-Web，2-H5，3-小程序，4-App
     */
    @NotNull(message = "商城环境不能为空")
    @ManageShopEnvironmentAnnotation
    private Integer shopEnvironment;

    /**
     * 订单来源商城名称
     */
    @NotBlank(message = "订单来源商城名称不能为空")
    @Size(max = 50, message = "订单来源商城名称最长50个字符")
    private String shopName;

    /**
     * 支付方式，0-无需支付，1-线上支付，2-线下支付，3-授信额度支付，4-货到付款，5-结算支付，10-积分支付
     */
    @NotNull(message = "支付方式要大于等于0")
    @OrderPayTypeAnnotation
    private Integer payType;

    /**
     * 支付渠道，0-无需支付，1-支付宝，2-微信，3-银联，4-余额支付，5-线下支付线上确认，6-授信额度支付，7-货到付款，8-月结，9-账期，10-积分支付
     */
    @NotNull(message = "支付渠道要大于等于0")
    @PositiveOrZero(message = "支付渠道要大于等于0")
    private Integer payChannel;

    /**
     * 总运费
     */
    @NotNull(message = "运费金额要大于等于0")
    @PositiveOrZero(message = "运费金额要大于等于0")
    private BigDecimal freight;

    /**
     * 税费
     */
    @NotNull(message = "税费金额要大于等于0")
    @PositiveOrZero(message = "税费金额要大于等于0")
    private BigDecimal taxes;

    /**
     * 促销活动优惠总金额
     */
    @NotNull(message = "促销活动优惠金额要大于等于0")
    @PositiveOrZero(message = "促销活动优惠金额要大于等于0")
    private BigDecimal promotionAmount;

    /**
     * 优惠券优惠总金额
     */
    @NotNull(message = "优惠券优惠金额要大于等于0")
    @PositiveOrZero(message = "优惠券优惠金额要大于等于0")
    private BigDecimal couponAmount;

    /**
     * 订单实付总金额
     */
    @NotNull(message = "订单实付总金额要大于等于0")
    @PositiveOrZero(message = "订单实付总金额要大于等于0")
    private BigDecimal totalAmount;

    /**
     * 收货地址，如商品配送方式中包含“物流”，则必须填写
     */
    @Valid
    private OrderConsigneeVO consignee;

    /**
     * 发票信息，如订单没有发票不需要填写此字段
     */
    @Valid
    private OrderInvoiceVO invoice;

    /**
     * 合同信息，如订单没有合同不需要填写此字段
     */
    @Valid
    private OrderContractVO contract;

    /**
     * 商品列表
     */
    @NotEmpty(message = "商品列表不能为空")
    @Valid
    private List<MobileOrderProductVO> products;

    /**
     * 优惠券列表，如订单没有优惠券则不需要填写此字段
     */
    @Valid
    private List<OrderCouponVO> coupons;

    /**
     * 积分抵扣列表，如订单没有使用积分抵扣则不需要填写此字段
     */
    @Valid
    private List<OrderDeductionVO> deductions;

    /**
     * 订单送货时间列表
     */
    @Valid
    private List<BuyerOrderDeliverTimeVO> deliverTimes;

    public Long getStoreId() {
        return storeId;
    }

    public void setStoreId(Long storeId) {
        this.storeId = storeId;
    }

    public Long getShopId() {
        return shopId;
    }

    public void setShopId(Long shopId) {
        this.shopId = shopId;
    }

    public Integer getShopType() {
        return shopType;
    }

    public void setShopType(Integer shopType) {
        this.shopType = shopType;
    }

    public Integer getShopEnvironment() {
        return shopEnvironment;
    }

    public void setShopEnvironment(Integer shopEnvironment) {
        this.shopEnvironment = shopEnvironment;
    }

    public String getShopName() {
        return shopName;
    }

    public void setShopName(String shopName) {
        this.shopName = shopName;
    }

    public Integer getPayType() {
        return payType;
    }

    public void setPayType(Integer payType) {
        this.payType = payType;
    }

    public Integer getPayChannel() {
        return payChannel;
    }

    public void setPayChannel(Integer payChannel) {
        this.payChannel = payChannel;
    }

    public BigDecimal getFreight() {
        return freight;
    }

    public void setFreight(BigDecimal freight) {
        this.freight = freight;
    }

    public BigDecimal getTaxes() {
        return taxes;
    }

    public void setTaxes(BigDecimal taxes) {
        this.taxes = taxes;
    }

    public BigDecimal getPromotionAmount() {
        return promotionAmount;
    }

    public void setPromotionAmount(BigDecimal promotionAmount) {
        this.promotionAmount = promotionAmount;
    }

    public BigDecimal getCouponAmount() {
        return couponAmount;
    }

    public void setCouponAmount(BigDecimal couponAmount) {
        this.couponAmount = couponAmount;
    }

    public BigDecimal getTotalAmount() {
        return totalAmount;
    }

    public void setTotalAmount(BigDecimal totalAmount) {
        this.totalAmount = totalAmount;
    }

    public OrderConsigneeVO getConsignee() {
        return consignee;
    }

    public void setConsignee(OrderConsigneeVO consignee) {
        this.consignee = consignee;
    }

    public OrderInvoiceVO getInvoice() {
        return invoice;
    }

    public void setInvoice(OrderInvoiceVO invoice) {
        this.invoice = invoice;
    }

    public OrderContractVO getContract() {
        return contract;
    }

    public void setContract(OrderContractVO contract) {
        this.contract = contract;
    }

    public List<MobileOrderProductVO> getProducts() {
        return products;
    }

    public void setProducts(List<MobileOrderProductVO> products) {
        this.products = products;
    }

    public List<OrderCouponVO> getCoupons() {
        return coupons;
    }

    public void setCoupons(List<OrderCouponVO> coupons) {
        this.coupons = coupons;
    }

    public List<OrderDeductionVO> getDeductions() {
        return deductions;
    }

    public void setDeductions(List<OrderDeductionVO> deductions) {
        this.deductions = deductions;
    }

    public List<BuyerOrderDeliverTimeVO> getDeliverTimes() {
        return deliverTimes;
    }

    public void setDeliverTimes(List<BuyerOrderDeliverTimeVO> deliverTimes) {
        this.deliverTimes = deliverTimes;
    }
}
